const express = require('express');
const router = express.Router();

router.get('/', (req, res) => {
    const content = [];
    for(let i = 0; i < 40; i++) content.push({
        id: `${i}`,
        code: `code${i}`,
        name: `name${i}`,
        brandId: `brandId${i}`,
        brandCode: `brandCode${i}`,
        brandName: `brandName${i}`,
        vin: `VIN${i}`,
        engineCode: `engineCode${i}`,
        status: 1,
        rolloutDate: '2020-03-12T08:24:12.684Z',
        productCode: `productCode${i}`,
        productName: `productName${i}`,
        productEnglishName: 'Kenneth Martin',
        productGroup: 10,
        modelCode: `modelCode${i}`,
        modelName: `modelName${i}`,
        productCategoryStyle: `productCategoryStyle${i}`,
        engineCylinder: `engineCylinder${i}`,
        colorCode: '上天空蓝下银',
        transmission: `transmission${i}`,
        rowVersion: 'string',
        options: ['update']
    });

    res.json({
        message: 'ok',
        payload: {
            content,
            totalElements: 40,
        }
    });
});

router.get('/:id', (req, res) => {
    res.json({
        message: 'ok',
        payload: {
            id: '001',
            brandId: 'brandId',
            brandName: 'brandName',
            vin: 'VINVINVINVIN',
            mileage: 1,
            keyCode: '12121212',
            productCode: 'string',
            productName: 'string',
            certificateNumber: 'string',
            certificateDate: '2020-03-12T08:24:12.684Z',
            engineCode: 'string',
            transmissionSn: 'string',
            rolloutDate: '2020-03-12T08:24:12.684Z',
            operationsNature: 1,
            manufacturerName: 'string',
            remark: 'string',
            requirementCode: 'string',
            bodyNumber: 'string',
            vehicleProperty: 1,
            certificateRFID: 'string',
            vehicleRFID: 'string',
            isBuckup: true,
            exportDestination: 'string',
            options: ['update'],
            rowVersion: 'string',
        },
    });
});
router.put('/:id', (req, res) => {
    res.json({
        message: '编辑成功'
    });
});
router.post('/import', async(req, res) => {
    res.json({
        message: 'KD车辆导入成功'
    });
});
router.get('/export', (req, res) => {
    res.json({
        message: '导出成功',
        payload: 'Mock导出'
    });
});
module.exports = router;
